<?php
class gui {
	public $ctrl;

	public function __construct($controller){
		$this->ctrl = $controller;
	}

	public function show(){
		$url = $this->ctrl->url;
		$page = "view/page/".$url[0].".php";
		if(!file_exists($page)){ $this->ctrl->redirect("error/404/".implode("/", $url)); }

		$root = $this->ctrl->root;
		$link = $root."index.php?url=";
		$self = implode("/", $url);

		$css = $root."public/css/";
		$img = $root."public/img/";
		$js = $root."public/js/";

		if($this->ctrl->msg != null){ $msg = $this->ctrl->msg; }
		if($this->ctrl->usr != null){ $usr = $this->ctrl->usr; }

		require($page);

		$this->ctrl->db->close();
	}
}
?>